home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-iafa-howftp-00.txt < prev    next >
Text File  |  1993-06-16  |  24KB  |  601 lines

  1.  
  2. INTERNET DRAFT                                               P. Deutsch
  3. Expires: December 30, 1993                                    A. Emtage
  4.                                                                  Bunyip
  5.                                                               A. Marine
  6.                                                               NASA NAIC
  7.                                                               June 1993
  8.  
  9.                     How to Use Anonymous FTP
  10.  
  11.  
  12. Status of This Memo
  13.  
  14. This document is an Internet-Draft.  Internet-Drafts are working
  15. documents of the Internet Engineering Task Force (IETF), its Areas,
  16. and its Working Groups.  Note that other groups may also distribute
  17. working documents as Internet-Drafts.  Internet-Drafts are draft
  18. documents valid for a maximum of six months.  Internet-Drafts may be
  19. updated, replaced, or obsoleted by other documents at any time.  It is
  20. not appropriate to use Internet-Drafts as reference material or to
  21. cite them other than as a "working draft" or "work in progress."
  22.  
  23. Please send comments to April Marine, amarine@atlas.arc.nasa.gov.
  24.  
  25.  
  26. Abstract
  27.  
  28. This document provides information for the novice Internet
  29. user about using the File Transfer Protocol (FTP).  It
  30. explains what FTP is, what anonymous FTP is, and what an
  31. anonymous FTP archive site is.  It shows a sample
  32. anonymous FTP session.  It also discusses common ways
  33. files are packaged for efficient storage and transmission.
  34.  
  35.  
  36. Acknowledgements
  37.  
  38. This document is the result of work done in the Internet
  39. Anonymous FTP Archives (IAFA) working group of the IETF.
  40. Special thanks are due to Mark Baushke (Cisco), John Curran
  41. (BBN), Aydin Edguer (CWRU), Rafal Maszkowski (Onsala Space
  42. Observatory), Marsha Perrott (PREPnet), Bob Peterson (Texas
  43. Instruments), Nathan Torkington (Victoria University of
  44. Wellington), and Stephen Tihor (NYU) for excellent comments
  45. and contributions.
  46.  
  47.  
  48. What is FTP?
  49.  
  50. FTP refers to the File Transfer Protocol, one of the protocols
  51. within the TCP/IP protocol suite used on the Internet.  The File
  52. Transfer Protocol makes it possible to transfer files from one
  53. computer (or host) on the Internet to another.  There are many FTP
  54. implementations built on the specification of the FTP protocol.  A
  55. user of an FTP program must log in to both hosts in order to
  56. transfer a file from one to the other.
  57.  
  58. It is common for a user with files on more than one host to
  59. use the FTP program to transfer files from one
  60. host to another.  In this case, the user has an account on
  61. both hosts involved, so he has passwords for both hosts.
  62.  
  63. However, Internet users may also take advantage of a wealth
  64. of information available from archive sites by using a
  65. general purpose account called "anonymous FTP".
  66.  
  67.  
  68. What is an Archive Site?
  69.  
  70. An archive site is a host that acts as a repository of
  71. information, much like a conventional library.  Information
  72. stored on these Internet hosts is made available for users
  73. to transfer to their local sites.  Users run software to
  74. identify this information and transfer it to their own
  75. hosts.  Such a transfer is done with a program that
  76. implements the File Transfer Protocol (FTP).
  77.  
  78.  
  79. What is Anonymous FTP?
  80.  
  81. Anonymous FTP is a means by which archive sites allow general
  82. access to their archives of information.  These sites create
  83. a special account called "anonymous."  User "anonymous" has
  84. limited access rights to the archive host, as well as some
  85. operating restrictions.  In fact, the only operations allowed
  86. are logging in using FTP, listing the contents of a limited
  87. set of directories, and retrieving files.  Some sites limit
  88. the contents of a directory listing an anonymous user can see
  89. as well.  Note that "anonymous" users are not usually allowed
  90. to transfer files TO the archive site, but can only retrieve
  91. files from such a site.
  92.  
  93. Traditionally, this special anonymous user account
  94. accepts any string as a password, although it is common to
  95. use either the password "guest" or one's electronic mail
  96. (e-mail) address.  Some archive sites now explicitly ask for
  97. the user's e-mail address and will not allow login with the
  98. "guest" password.  Providing an e-mail address is a courtesy
  99. that allows archive site operators to get some idea of who
  100. is using their services.
  101.  
  102.  
  103. What Information Do You Need to Know?
  104.  
  105. To retrieve a specific file, a user needs to know what host
  106. it is on, and the pathname of the file.  A pathname tells
  107. the directory (and possibly subdirectories) that house the
  108. file, and the name of the file.  Often discussions of
  109. available files will not specifically say, "This file is
  110. available for anonymous FTP from X host with Y pathname."
  111. However, if a file is publicly announced as available and
  112. referred to as something like pub/good-stuff on
  113. nisc.sri.com, it is a good assumption that you can try to
  114. transfer it.
  115.  
  116. You may also need to know if your machine uses an ASCII,
  117. EBCDIC, or other character set to know how likely a transfer
  118. of binary information will work, or whether such a transfer will
  119. require other keywords, such as is true for TENEX.
  120.  
  121. In the general case, you may assume that an ASCII transfer
  122. will always do the right thing for plain text files.
  123. However, more and more information is being stored in various
  124. compressed formats (which are discusssed later in this
  125. document), so knowing the binary characteristics of your
  126. machine may be important.
  127.  
  128.  
  129.  
  130. A Sample Session
  131.  
  132. To start an FTP session on a UNIX or VMS host, you type
  133. "ftp" and the host name or host IP address of the machine to
  134. which you want to connect.  For example, if you wish to
  135. access the DDN Newtork Information Center (NIC) archive
  136. site, you would normally execute one of the following
  137. commands at the UNIX prompt:
  138.  
  139.         ftp nic.ddn.mil
  140. or
  141.         ftp 192.112.36.5
  142.  
  143. Observe that the first form uses the fully-qualified domain
  144. name and the second uses the Internet address for the same
  145. host.
  146.  
  147.  
  148. The following is an example of connecting to the nic.ddn.mil
  149. host to retrieve RFC 959, "File Transfer Protocol (FTP)."
  150.  
  151. Note several things about the session.
  152.  
  153.  1. Every response the FTP program at the archive site gives
  154.     is preceded by a number.  These numbers are called
  155.     Reply Codes and are defined in the FTP specification,
  156.     RFC 959.  The text that accompanies these reply codes
  157.     can vary in different FTP implementations, and usually does.  Note
  158.     that the nic.ddn.mil administrator has chosen to provide
  159.     a list of directories to users when they log in.  This
  160.     is unusual; normally users interested in knowing the
  161.     list of accessible directories must give a command to
  162.     list them.
  163.  
  164.     Also note that some FTP client implementations (eg, MVS
  165.     systems) may not echo the reply codes or text as
  166.     transmitted from the remote host.  They may generate their
  167.     own status lines or just hide the non-fatal replies
  168.     from you.  For the purposes of this document, the more
  169.     popular UNIX interface to the FTP client will be
  170.     presented.
  171.  
  172.  2. The password you type is never shown on your screen.
  173.  
  174.  3. It is possible to "browse" in archives, but often users
  175.     already know the pathname of the file they want.  The
  176.     pathname for RFC 959 is rfc/rfc959.txt.  In the example, we
  177.     first connect to the 'rfc' directory (cd rfc), then get
  178.     the specific file we know we want.  If you do not know 
  179.     the name of the file you want, a file called README or
  180.     something similar (00README.1ST, AAREAD.ME, INDEX, etc.)
  181.     is probably the one to retrieve first.
  182.     
  183.  
  184. paris% ftp nic.ddn.mil
  185. Connected to nic.ddn.mil.
  186. 220-*****Welcome to the Network Information Center*****
  187.     *****Login with username "anonymous" and password "guest"
  188.     *****You may change directories to the following:
  189.       ddn-news          - DDN Management Bulletins
  190.       domain            - Root Domain Zone Files
  191.       iesg              - IETF Steering Group
  192.       ietf              - Internet Engineering Task Force
  193.       internet-drafts   - Internet Drafts
  194.       netinfo           - NIC Information Files
  195.       netprog           - Guest Software (ex. whois.c)
  196.       protocols         - TCP-IP & OSI Documents
  197.       rfc               - RFC Repository
  198.       scc               - DDN Security Bulletins
  199.       std               - Internet Protocol Standards
  200. 220 And more!
  201. Name (nic.ddn.mil:april):anonymous
  202. 331 Guest login ok, send "guest" as password.
  203. Password:
  204. 230 Guest login ok, access restrictions apply.
  205. ftp>cd rfc
  206. 250 CWD command successful.
  207. ftp>get rfc959.txt
  208. 200 PORT command successful.
  209. 150 Opening ASCII mode data connection for rfc959.txt (146316 bytes).
  210. 226 Transfer complete.
  211. local: rfc959.txt remote: rfc959.txt
  212. 151249 bytes received in 10 seconds (15 Kbytes/s)
  213. ftp>quit
  214. 221 Goodbye.
  215. paris%
  216.  
  217.  
  218.  
  219. Variations
  220.  
  221. The above example is of the FTP program available on UNIX
  222. systems.  Other operating systems also make FTP programs
  223. available.  The actual commands you type may vary somewhat
  224. with other programs.  However, in general, you will do the
  225. following with every FTP program:
  226.  
  227.   - Log in to your local host, and invoke the FTP program.
  228.  
  229.   - Open a connection to the host (using either the host name
  230.     or its IP address)
  231.  
  232.   - Once connected to the remote host, log in with username
  233.     "anonymous." 
  234.  
  235.   - Provide either the password "guest" or whatever the password the
  236.     site requests.
  237.  
  238.   - Issue whatever FTP commands you require, such as those to
  239.     change directories or to retrieve a file.
  240.  
  241.   - When finished, exit the FTP program, which will close your
  242.     connection to the archive host.
  243.  
  244.  
  245. Other FTP Commands
  246.  
  247. We have demonstrated some of the commands available with FTP
  248. programs.  Many others are possible.  For example, once you
  249. have logged in to a remote host:
  250.  
  251.   - You may ask the FTP program to display a list of available
  252.     commands, typically by invoking the FTP program without
  253.     arguments and typing "help."
  254.  
  255.   - You may view the contents of the directory to which you are
  256.     connected.  Type "dir" or "ls" to do so.
  257.     
  258.   - You may rename a file by using the "get" command's
  259.     optional local file name, which follows the remote file
  260.     name on the command line.  You probably should rename a
  261.     file when the remote file name exceeds your local file
  262.     system's naming constraints, e.g.  if the remote file
  263.     name is too long.  An example of using the "get" command
  264.     to rename a file when transferring it might be "get
  265.     really-long-named-file.txt short.txt".
  266.  
  267.   - You may set BINARY mode to transfer executable programs or files
  268.     of data.  Type "binary" to do so.  Usually
  269.     FTP programs assume files use only 7 bits per byte, the norm for
  270.     standard ASCII-encoded files.  The BINARY command allows you to
  271.     transfer files that use the full 8 bits per byte without error,
  272.     but this may have implications on how the file is transferred
  273.     to your local system.
  274.     
  275.     If you are not sure what format a file is in, you may need to
  276.     transfer it a second time in the other mode (BINARY or ASCII)
  277.     if your first guess is wrong.  The extension at the end of the
  278.     file name may give you a clue.  File name extensions are described 
  279.     below.
  280.  
  281.     Because some machines store text files differently than others,
  282.     you may have to try your luck if you're not sure what format
  283.     a file is in.  A good guess is to try ASCII mode first, if
  284.     you have grounds to suspect the file is a text file.  Otherwise,
  285.     try BINARY mode.  Try TENEX mode as a last resort.
  286.  
  287.   - You may transfer multiple files at the same time.  To set this
  288.     mode, type "mget."  You then supply a file name pattern that
  289.     the remote system understands and it tries to transfer each
  290.     file in turn.  If your local FTP user agent cannot transform
  291.     the remote file names into legal local file names, or if there
  292.     are some files that must be transfered in ASCII mode and others
  293.     that must be transfered in BINARY mode, you may not be able to
  294.     take advantage of this facility.
  295.  
  296.  
  297. Full details on the commands and options available
  298. are in the FTP documentation that comes with your system.
  299. You can also type "help" at the FTP command prompt for
  300. a list of command options.
  301.  
  302. A copy of the UNIX version of the FTP documentation is
  303. available from the online manual.  If your UNIX site has the
  304. manuals installed, type the following at the UNIX prompt:
  305.  
  306.     % man ftp
  307.  
  308.  
  309.  
  310. The Packaging and Naming of Files
  311.  
  312. Several widely used conventions allow for efficient storage and
  313. transmission of information stored at archive sites.
  314.  
  315. Information stored on archive sites is often "transformed" in three
  316. common ways.  "Compressing" (reducing the size of) the stored
  317. information makes more space available on the archive, and reduces the
  318. amount of data actually transferred across the network.  "Bundling"
  319. several files into one larger file maintains the internal directory
  320. structure of the components, and allows users to transfer only one
  321. larger object rather than several (sometimes hundreds) of smaller
  322. files.  
  323.  
  324. In addition, binary data is often converted into an ASCII
  325. format for transmission, a process referred to in this
  326. document as "transformation."  Traditionally, Internet RFC
  327. 822-based electronic mail and USENET protocols did not allow
  328. the transmission of "binary" (8-bit) data; therefore, files
  329. in binary format had to be transformed into printable 7-bit
  330. ASCII before being transmission.
  331.  
  332. On many systems, various file naming conventions are used to help the
  333. remote user to determine the format of the stored information without
  334. first having to retrieve the files.  Below we list the more common
  335. compression, bundling, and transformation conventions used on the
  336. Internet.  This list is not intended to be exhaustive.  In all cases
  337. public domain or freely-available implementations of the programs
  338. associated with these mechanisms are available on the
  339. network.
  340.  
  341.   1) compress/uncompress
  342.  
  343.   Filenames terminating in ".Z" normally signify files that have been
  344.   compressed by the standard UNIX Lempel-Ziv "compress" utility.
  345.   There is an equivalent program called "uncompress" to reverse the
  346.   process and return the file to its original state.  No bundling
  347.   mechanism is provided, and the resulting files are always in binary
  348.   format, regardless of the original format of the input data.
  349.  
  350.   2) atob/btoa
  351.  
  352.   Performs a transformation of ASCII to binary (atob) and the reverse
  353.   (btoa) in a standard format.  Files so transformed often have
  354.   filenames terminated with ".atob".  No bundling or compression
  355.   mechanisms are used.
  356.  
  357.   3) atox/xtoa
  358.  
  359.   A data transformation standard used to convert binary files to
  360.   transferable ASCII format.  Sometimes used in preference to other
  361.   similar mechanisms because it is more space efficient;  however, it is
  362.   not a compression mechanism per se.  It is just more efficient in the
  363.   transformation from one format to the other.  Filenames of files in
  364.   this format often have the ".atox" extension.
  365.  
  366.   4) uuencode/uudecode
  367.  
  368.   Transforms ASCII to binary ("uuencode") and the reverse ("uudecode")
  369.   transformation in a standard manner.  Originally used in the UUCP
  370.   ("Unix to Unix CoPy") mail/USENET system.  No bundling or
  371.   compression mechanisms are used.  Naming conventions often add
  372.   a .uu at the end of the file name.
  373.  
  374.   5) tar/untar
  375.  
  376.   Originally a UNIX based utility for bundling (and unbundling)
  377.   several files and directories into (and from) a single file (the
  378.   acronym stands for "Tape ARchive").  Standard format provides no
  379.   compression mechanism.  The resulting bundled file is always in
  380.   binary format regardless of whether the constituent files are binary
  381.   or not.  Naming conventions usually hold that the filename of a
  382.   "tarfile" contain the sequence ".tar" or "-tar".
  383.  
  384.   6) zip/unzip
  385.  
  386.   Often used in IBM PC environments, these complementary programs
  387.   provide both bundling and compression mechanisms.  The resulting
  388.   files are always in binary format.  Files resulting from the "zip"
  389.   program are by convention terminated with the ".zip" filename
  390.   extension.
  391.  
  392.   7) arc/unarc
  393.  
  394.   Often used in IBM PC environments, these complementary programs
  395.   provide both bundling and compression mechanisms.  The resulting
  396.   files are always in binary format.  Files stored in this format
  397.   often have a ".arc" filename extension.
  398.  
  399.   8) binhex
  400.  
  401.   Used in the Apple MacIntosh environment, the binhex process provides
  402.   bundling as well as binary to ASCII data transformations.  Files in
  403.   this format by convention have a filename extension of ".hqx".
  404.  
  405.   9) shar
  406.  
  407.   Bourse shell archives package text or binary files into a single longer
  408.   file which, when executed, will create the component files.  Because this 
  409.   format is vulnerable to misuse, most users use a special tool called unshar
  410.   to decode these archives.  By convention, files in this format have a 
  411.   filename extension of ".shar".
  412.  
  413.   10) VMS_SHARE
  414.  
  415.   DCL archives package text or binary files into a single longer
  416.   file which, when executed, will created the component files.  Because this 
  417.   format is vulnerable to misuse, care must be take to examine such an
  418.   archive before executing it.  By convention, files in this format have a 
  419.   filename extension of ".shar".
  420.  
  421.   11) Multipart shar/vms_share files
  422.  
  423.   Sometimes these shell archive files are broken into multiple
  424.   small parts to simplify their transfer over other forms of
  425.   fileservers that share the same archive tree.  In such cases, the
  426.   parts of the files are usually suffixed with a part number (e.g.
  427.   xyz.01 xyz.02 xyz.03 ... or even .01-of-05).  Collect all the
  428.   parts, concatenate them on your local system, and then apply the
  429.   procedure listed above for a simple shar or vms_share file
  430.   to the concatenated file you just made.
  431.  
  432.   12) zoo
  433.  
  434.   The zoo program implements compression/decompression and
  435.   bundling/unbundling in a single program.  Utilities supporting the
  436.   zoo format exist on a wide variety of systems, including Unix, MS-DOS,
  437.   Macintosh, OS/2, Atari ST, and VAX VMS.  Files created by the "zoo"
  438.   programs by convention end with the ".zoo" filename extension.  Zoo
  439.   is a popular distribution format due to the availability of free
  440.   implementations (both source and executable code) on a wide variety
  441.   of operating systems.
  442.  
  443. 13) gzip/gunzip
  444.  
  445.   The Free Software Foundation GNU project adopted a variant
  446.   of the zip compression mechanism as a substitute for the
  447.   compress/uncompress commands.  The resulting files are
  448.   always in binary format.  Files resulting from the "gzip"
  449.   program are by convention terminated with the ".z" or ".gz"
  450.   filename extensions.  The gunzip program also recognizes
  451.   ".tgz" and ".taz" as shorthands for ".tar.z" or ".tar.Z".
  452.   Also, gunzip can recognize and decompress files created by
  453.   the gzip, zip, compress, or pack commands.
  454.  
  455.   The GNU project recently began distributing and using the
  456.   gzip/gunzip utilities.  Even more recently they changed the
  457.   default suffix from .z to .gz, in an attempt to (1) reduce
  458.   confusion with .Z, and (2) eliminate a problem with
  459.   case-insensitive file systems such as MS-DOS.  The gzip
  460.   software is freely redistributable and has been ported to
  461.   most UNIX systems, as well as Amiga, Atari, MSDOS, OS2, and
  462.   VMS systems.
  463.  
  464.    
  465. In some cases, a series of the above processes are performed to
  466. produce the final file as stored on the archive.  In cases where
  467. multiple transformation processes have been used, tradition holds that
  468. the original (base) filename be changed to reflect these processes,
  469. and that the associated filename extensions be added in the order in
  470. which the processes were performed.  For example, a common procedure is
  471. first to bundle the original files and directories using the "tar"
  472. process, then to "compress" the bundled file.  Starting with a base
  473. file name of "foobar", the file name in the archive would become
  474. "foobar.tar.Z".  As this is a binary file, it would require a further
  475. transformation into printable ASCII by a program such as "uuencode" in
  476. order to be transmitted over traditional email or USENET facilities,
  477. so it might finally be called "foobar.tar.Z.uu."
  478.  
  479. Some operating systems can not handle multiple periods; in such cases 
  480. they are often replaced by hyphen ( - ), underscore ( _ ), or by
  481. detailed instructions in the "read me" files in the directories.
  482.  
  483.  
  484. Compress and Tar
  485.  
  486. Here is an example of the use of the "compress/uncompress" and 
  487. "tar/untar" programs.
  488.  
  489. Suppose "patch" is a useful public domain program for applying program
  490. patches and updates.  You find this file at an archive site as
  491. "patch.tar.Z".  Now you know that the ".Z" indicates that the file was
  492. compressed with the UNIX "compress" command, and the ".tar" indicates
  493. that it was tar'ed using the UNIX "tar" tape archive command.
  494.  
  495. First retrieve the file onto your machine using anonymous FTP.  To
  496. unpack this program, you would first  uncompress it by typing:
  497.  
  498.    uncompress patch.tar.Z
  499.  
  500. This will uncompress the file, and in the process, rename
  501. it to "patch.tar".  You can then execute the "tar" command to
  502. extract the individual files.
  503.  
  504. In the example of patch.tar, you could invoke the command
  505. as:
  506.  
  507.     % tar xvf patch.tar
  508.  
  509. The files would be extracted (that's the 'x' argument to
  510. tar) from the file patch.tar (that's the 'f' argument).
  511. Because we use the 'v' (for verbose) argument, the name
  512. of each file is printed as it is extracted.  When tar is
  513. complete you should have all the files that make up the
  514. "patch" program in your working directory.
  515.  
  516.  
  517. Etiquette
  518.  
  519. Not every site that supports FTP permits anonymous tranfers.  It is
  520. wrong to try to get files from systems that have not advertised the
  521. availability of such a service. 
  522.  
  523. Remember that Internet site administrators for archive sites
  524. have made their systems available out of a sense of
  525. community.  Rarely are they fully compensated for the time
  526. and effort it takes to administer such a site.  There are
  527. some things users can do to make their jobs somewhat easier,
  528. such as checking with local support personnel first if
  529. problems occur before asking the archive adminstrator for help.
  530.  
  531. Most archive machines perform other functions as well.
  532. Please respect the needs of their primary users and restrict
  533. your FTP access to non-prime hours (generally between 1900
  534. and 0600 hours local time for that site) whenever possible.
  535. It is especially important to remember this for sites
  536. located on another continent or across a significant body of
  537. water because most such links are relatively slow and heavily loaded.
  538.  
  539. In addition, some sites offering anonymous FTP limit the number of
  540. concurrent anonymous FTP logins.  If your attempt to log onto such a
  541. site results in an error message to the effect that too many anonymous
  542. FTP users are online, you should wait a while before attempting
  543. another connection rather than retrying immediately.
  544.  
  545. To reduce redundant storage, you should find out how to make useful
  546. the files you fetch using FTP available to your entire
  547. organization.  If you retrieve and test a program that turns out to
  548. be useful, you should probably ask your administrator to consider
  549. making the program generally available, which will reduce the
  550. redundant effort and disk space resulting from multiple individuals
  551. installing the same package in their personal directories.
  552.  
  553. If you find an interesting file or program on an archive
  554. site, tell others about it.  You should not copy the
  555. file or program to your own archive unless you are
  556. willing to keep your copy current.
  557.  
  558.  
  559. Security Considerations
  560.  
  561. Security considerations are not discussed in this document.
  562.  
  563.  
  564. Authors' Addresses
  565.  
  566.   Peter Deutsch
  567.   Bunyip Information Systems
  568.   266 Blvd. Neptune  
  569.   Dorval, Quebec, H9S 2L4
  570.   Canada
  571.  
  572.   Phone: (514) 398-3709
  573.   EMail: peterd@bunyip.com
  574.  
  575.  
  576.   Alan Emtage
  577.   Bunyip Information Systems
  578.   266 Blvd. Neptune  
  579.   Dorval, Quebec, H9S 2L4
  580.   Canada
  581.  
  582.   Phone: (514) 398-3709
  583.   EMail: bajan@bunyip.com
  584.  
  585.  
  586.   April N. Marine
  587.   NASA NAIC
  588.   M/S 233-18
  589.   Ames Research Center
  590.   Moffett Field, CA 94035-1000
  591.  
  592.   Phone: (415) 604-0762
  593.   EMail: amarine@atlas.arc.nasa.gov
  594.  
  595.  
  596.  
  597.  
  598. This Internet Draft expires December 30, 1993.
  599.  
  600.  
  601.